#include <iostream>
#include <unistd.h>
#include <string.h>
#include "ShareMemory.hpp"
#include "Time.hpp"
#include "Fifo.hpp"

int main()
{
    shm.CreateShm();
    shm.AttachShm();
    gpipe.OpenPipeForRead();

    // 这里进行IPC
    struct data *image = (struct data *)shm.GetAddr();

    while (true)
    {
        gpipe.Wait();

        printf("status: %s\n", image->status);
        printf("lasttime: %s\n", image->lasttime);
        printf("image: %s\n", image->image);
        strcpy(image->status, "过期");
    }

    shm.DetachShm();
    shm.DeleteShm();

    return 0;
}
